using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DevExpress.ExpressApp.DC;
using DevExpress.Persistent.Base;
using DevExpress.Persistent.BaseImpl;
using DevExpress.Xpo;
using DevExpress.Persistent.Validation;
namespace Ascent.QiPei.Module.BusinessObjects.Inventory
{
  [DefaultClassOptions]
  [DevExpress.Persistent.Base.NavigationItemAttribute("库存管理")]
  [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("库存盘点")]
  [DevExpress.ExpressApp.DC.XafDefaultPropertyAttribute("盘点负责人")]
  public partial class InventoryVerification : DevExpress.Persistent.BaseImpl.BaseObject
  {
    private Ascent.QiPei.Module.BusinessObjects.Systems.ShopStore _shopStore;
    private System.String _remark;
    private System.DateTime _updateDate;
    private Ascent.QiPei.Module.BusinessObjects.Base.Employee _updateUser;
    private System.Boolean _isUpdateFlag;
    private Ascent.QiPei.Module.BusinessObjects.Base.Employee _employee;
    private System.DateTime _inventoryDate;
    private System.String _fVFCode;
    public InventoryVerification(DevExpress.Xpo.Session session)
      : base(session)
    {
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("单号")]
    [RuleRequiredField(DefaultContexts.Save)]
    public System.String FVFCode
    {
      get
      {
        return _fVFCode;
      }
      set
      {
        SetPropertyValue("FVFCode", ref _fVFCode, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("店铺")]
    public Ascent.QiPei.Module.BusinessObjects.Systems.ShopStore ShopStore
    {
      get
      {
        return _shopStore;
      }
      set
      {
          SetPropertyValue("ShopStore", ref _shopStore, value);
        //if (_shopStore == value)
        //  return;
        //Ascent.QiPei.Module.BusinessObjects.Systems.ShopStore prevShopStore = _shopStore;
        //_shopStore = value;
        //if (IsLoading)
        //  return;
        //if (prevShopStore != null && prevShopStore.InventoryVerification == this)
        //  prevShopStore.InventoryVerification = null;
        //if (_shopStore != null)
        //  _shopStore.InventoryVerification = this;
        //OnChanged("ShopStore");
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("盘点日期")]
    [RuleRequiredField(DefaultContexts.Save)]
    public System.DateTime InventoryDate
    {
      get
      {
        return _inventoryDate;
      }
      set
      {
        SetPropertyValue("InventoryDate", ref _inventoryDate, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("盘点负责人")]
    public Ascent.QiPei.Module.BusinessObjects.Base.Employee Employee
    {
      get
      {
        return _employee;
      }
      set
      {
          SetPropertyValue("Employee", ref _employee, value);
        //if (_employee == value)
        //  return;
        //Ascent.QiPei.Module.BusinessObjects.Base.Employee prevEmployee = _employee;
        //_employee = value;
        //if (IsLoading)
        //  return;
        //if (prevEmployee != null && prevEmployee.InventoryVerification == this)
        //  prevEmployee.InventoryVerification = null;
        //if (_employee != null)
        //  _employee.InventoryVerification = this;
        //OnChanged("Employee");
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("是否已调整库存")]
    public System.Boolean IsUpdateFlag
    {
      get
      {
        return _isUpdateFlag;
      }
      set
      {
        SetPropertyValue("IsUpdateFlag", ref _isUpdateFlag, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("审核日期")]
    public System.DateTime UpdateDate
    {
      get
      {
        return _updateDate;
      }
      set
      {
        SetPropertyValue("UpdateDate", ref _updateDate, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("审核人")]
    public Ascent.QiPei.Module.BusinessObjects.Base.Employee UpdateUser
    {
      get
      {
        return _updateUser;
      }
      set
      {
          SetPropertyValue("UpdateUser", ref _updateUser, value);
        //if (_updateUser == value)
        //  return;
        //Ascent.QiPei.Module.BusinessObjects.Base.Employee prevUpdateUser = _updateUser;
        //_updateUser = value;
        //if (IsLoading)
        //  return;
        //if (prevUpdateUser != null && prevUpdateUser.InventoryVerification == this)
        //  prevUpdateUser.InventoryVerification = null;
        //if (_updateUser != null)
        //  _updateUser.InventoryVerification = this;
        //OnChanged("UpdateUser");
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("备注")]
    public System.String Remark
    {
      get
      {
        return _remark;
      }
      set
      {
        SetPropertyValue("Remark", ref _remark, value);
      }
    }
    [DevExpress.Xpo.AssociationAttribute("InventoryVerificationItemses-InventoryVerification")]
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("明细")]
    public XPCollection<Ascent.QiPei.Module.BusinessObjects.Inventory.InventoryVerificationItems> InventoryVerificationItemses
    {
      get
      {
        return GetCollection<Ascent.QiPei.Module.BusinessObjects.Inventory.InventoryVerificationItems>("InventoryVerificationItemses");
      }
    }
  }
}
